package vista;

import java.awt.BorderLayout;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

import controlador.ContProducto;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class DlgProducto extends javax.swing.JDialog {
	private JPanel PnlProducto;
	private JLabel lblNombre;
	private JTextField txtNombre;
	private JLabel lblCategoria;
	private JButton btSalir;
	private JButton btAceptar;
	private JButton btQuitar;
	private JButton btAnadir;
	private JTextField txtPrecio;
	private JLabel lblPrecio;
	private JScrollPane jScrollPane1;
	private JTable tblIngredientes;
	private JComboBox cbCategoria;
	private ContProducto controlador;
	
	public DlgProducto(JFrame frame, ContProducto controlador) {
		super(frame);
		this.controlador = controlador;
		initGUI();
	}
	
	private void initGUI() {
		try {
			{
				this.setTitle("Producto");
			}
			{
				PnlProducto = new JPanel();
				getContentPane().add(PnlProducto, BorderLayout.CENTER);
				PnlProducto.setLayout(null);
				PnlProducto.setPreferredSize(new java.awt.Dimension(408, 364));
				{
					lblNombre = new JLabel();
					PnlProducto.add(lblNombre);
					lblNombre.setText("Nombre:");
					lblNombre.setBounds(34, 25, 53, 14);
				}
				{
					txtNombre = new JTextField();
					PnlProducto.add(txtNombre);
					txtNombre.setBounds(111, 22, 219, 21);
				}
				{
					lblCategoria = new JLabel();
					PnlProducto.add(lblCategoria);
					lblCategoria.setText("Categoria:");
					lblCategoria.setBounds(34, 56, 65, 19);
				}
				{
					ComboBoxModel cbCategoriaModel = 
						new DefaultComboBoxModel(
								new String[] { "Item One", "Item Two" });
					cbCategoria = new JComboBox();
					PnlProducto.add(cbCategoria);
					cbCategoria.setModel(cbCategoriaModel);
					cbCategoria.setBounds(111, 55, 147, 21);
				}
				{
					jScrollPane1 = new JScrollPane();
					PnlProducto.add(jScrollPane1);
					jScrollPane1.setBounds(34, 133, 351, 109);
					{
						tblIngredientes = new JTable();
						jScrollPane1.setViewportView(tblIngredientes);
						tblIngredientes.setBounds(46, 115, 345, 87);
					}
				}
				{
					lblPrecio = new JLabel();
					PnlProducto.add(lblPrecio);
					lblPrecio.setText("Precio:");
					lblPrecio.setBounds(34, 96, 43, 14);
				}
				{
					txtPrecio = new JTextField();
					PnlProducto.add(txtPrecio);
					txtPrecio.setBounds(111, 93, 69, 21);
				}
				{
					btAnadir = new JButton();
					PnlProducto.add(btAnadir);
					btAnadir.setText("Agregar");
					btAnadir.setBounds(118, 248, 81, 21);
				}
				{
					btQuitar = new JButton();
					PnlProducto.add(btQuitar);
					btQuitar.setText("Quitar");
					btQuitar.setBounds(223, 248, 81, 21);
				}
				{
					btAceptar = new JButton();
					PnlProducto.add(btAceptar);
					btAceptar.setText("Aceptar");
					btAceptar.setBounds(205, 309, 89, 27);
				}
				{
					btSalir = new JButton();
					PnlProducto.add(btSalir);
					btSalir.setText("Salir");
					btSalir.setBounds(322, 309, 63, 27);
				}
			}
			this.setSize(418, 377);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public JPanel getPnlProducto() {
		return PnlProducto;
	}

	public JLabel getLblNombre() {
		return lblNombre;
	}

	public JTextField getTxtNombre() {
		return txtNombre;
	}

	public JLabel getLblCategoria() {
		return lblCategoria;
	}

	public JButton getBtSalir() {
		return btSalir;
	}

	public JButton getBtAceptar() {
		return btAceptar;
	}

	public JButton getBtQuitar() {
		return btQuitar;
	}

	public JButton getBtAnadir() {
		return btAnadir;
	}

	public JTextField getTxtPrecio() {
		return txtPrecio;
	}

	public JLabel getLblPrecio() {
		return lblPrecio;
	}

	public JTable getTblIngredientes() {
		return tblIngredientes;
	}

	public JComboBox getCbCategoria() {
		return cbCategoria;
	}
	
	public void mostrarMensaje(String mensaje) {
		JOptionPane.showMessageDialog(this, mensaje);
	}
}

